format date in php

34

format date in php -

$myDateTime = DateTime::createFromFormat('Y-m-d', $dateString);
$newDateString = $myDateTime->format('d-m-Y');

Comments

Submit
0 Comments